<?php
require_once("../classes/database.class.php");

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * User class
 * Makes user object when user is exists in the database
 * 
 * @author Marc Bruins
 */
class user {
    //put your code here
    private $username;
    private $status;
    private $dbCon;
    private $blowFish;
    
    
    public function user(){
        $this->dbCon = new Database();
        $this->dbCon->connectToDB();
        $this->blowFish = new Bcrypt(15);
    }
    
    public function loginUser($user,$password){
        $hash = $this->blowFish->hash($password);
        echo $hash."<br/>";
        $result = $this->dbCon->userLogin($user,$hash);
      //  print_r($result);
        //1 voor true
        if($result){
            $this->username = $user;
            $status = "true";
        }else{
            $status = "false";
        }
        
        return $status;
        
    }
    
    
}

?>
